package com.gang.ssm.bos.system.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gang.ssm.bos.core.toolbox.ajax.AjaxResult;
import com.gang.ssm.bos.system.bean.District;
import com.gang.ssm.bos.system.service.DistrictService;

@RequestMapping("/district")
@Controller
public class DistrictHandler extends BosController{
	
	@Autowired
	private DistrictService districtService;
	
	@ResponseBody
	@RequestMapping("/findDistrictByCityId")
	public AjaxResult findAllByProvinceId(Integer cid) {
		try {
			List<District> districts = districtService.findAllByCid(cid);
			return success(districts);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return fail("获取信息失败!");
		
	}

}
